#ifndef _COMMON_MUTEX_H_
#define _COMMON_MUTEX_H_

#include "sysdef.h"

class CMutex
{
public:

    CMutex();
    ~CMutex();

    int Lock();
    int Unlock();

private:

#ifdef WIN32
    CRITICAL_SECTION m_cs;
#else
    pthread_mutex_t m_lock;
#endif
};

//class CSpinlock
//{
//public:
//
//    CSpinlock();
//    ~CSpinlock();
//
//    int Lock();
//    int Unlock();
//
//private:
//
//#ifdef WIN32
//    CRITICAL_SECTION m_cs;
//#else
//    pthread_spinlock_t m_spinlock;
//#endif
//};

#endif //_COMMON_MUTEX_H_
